class Ex4
  def swap_case()
    inp = File.new("ex4in.txt","r")
    out = File.new("ex4out.txt", "w")
    out.print(inp.gets.swapcase)
    
  rescue => err
    if (inp == nil)
      puts ("file not found")
    end
  end
end


  ex4 = Ex4.new()
  ex4.swap_case()
  
